package com.briup.recognition.web.controller;

import com.briup.recognition.bean.UserRole;
import com.briup.recognition.service.IUserRoleService;
import com.briup.recognition.utils.Message;
import com.briup.recognition.utils.MessageUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/userRole")
public class UserRoleController {
    @Autowired
    private IUserRoleService userRoleService;

    @GetMapping("query")
    public Message saveOrUpdate(UserRole userRole){
        userRoleService.saveOrUpdate(userRole);
        return MessageUtil.success("操作成功");
    }

    @DeleteMapping("deleteById")
    public Message deleteById(long id){
        userRoleService.deleteById(id);
        return MessageUtil.success("删除成功");
    }
}
